<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<script language="javascript">
	function viewThesisDetails(thesisId) {
		$('#thesisId').val(thesisId);
		$('#studentDetailsForm').attr('action', 'viewThesisDetails.html');
		$('#studentDetailsForm').submit();
	}
	
	function printStudentDetails(studentId){
		$('#studentId').val(studentId);
		$('#studentDetailsForm').attr('action', 'printStudentDetails.html');
		$('#studentDetailsForm').submit();
	}
</script>

<%@include file="/ui/jsp/includes/header.jspf"%>
<div class="container-fluid">

    <form:form id="studentDetailsForm" class="form-horizontal" method="POST" target="_blank">
		<div class="addnew_button" align="right">
			<input type="button" title="Display in a Print-friendly Format" value="Print" onclick="javascript:printStudentDetails('${student.studentId}')" class="btn btn-primary">
		</div>
        <div id="top" class="hero-unit">

            <div id="thesis-details-header"> Student Details
            </div>
            <hr>

            <div class="control-group">

                <label class="control-label">Full Name:</label>
                <div class="controls"> ${student.getFullName()}</div>
                <label class="control-label">N Number:</label>
                <div class="controls"> ${student.nnumber}</div>
                <c:if test="${empty student.nnumber}">
                <br/>
                </c:if>
                <label class="control-label">Email:</label>
                <div class="controls"> ${student.email}</div>
                <c:if test="${empty student.email}">
                <br/>
                </c:if>
                <label class="control-label">Major:</label>
                <div class="controls"> ${student.major}</div>
                <c:if test="${empty student.major}">
                <br/>
                </c:if>
                <label class="control-label">Year Graduated:</label>
                <div class="controls"> ${student.yearGraduated}</div>
                <c:if test="${empty student.yearGraduated}">
                <br/>
                </c:if>
                <c:if test="${studentThesis != null}">
                	<label class="control-label">Thesis Title:</label>
					<div class="controls">
						<a href="javascript:viewThesisDetails('${studentThesis.thesisId}')">${studentThesis.title}</a>
					</div>
				</c:if>

            </div>
        </div>
        <input type="hidden" id="thesisId" name="thesisId" value=""/>
        <input type="hidden" id="studentId" name="studentId" value=""/>
    </form:form>
    <%-- 
    <form class="form-horizontal">
    	<div id="bottom" class="hero-unit">
    		<div id="thesis-details-header"> Student Thesis Details
            </div>
            <hr>
            
            <div class="control-group">
				<label class="control-label">Thesis Title:</label>
				<div class="controls">${studentThesis.title}</div>

				<label class="control-label">Abstract:</label>
				<div class="controls">${studentThesis.abstract_}</div>
				<c:if test="${empty studentThesis.abstract}">
                <br/>
                </c:if>

				<label class="control-label">Thesis DOI:</label>
				<div class="controls">${studentThesis.thesisDoi}</div>
				<c:if test="${empty studentThesis.thesisDoi}">
                <br/>
                </c:if>

				<label class="control-label">Category:</label>
				<div class="controls">${studentThesis.category.categoryName}</div>
				
			</div>
            
    	</div>
	</form>
	--%>
</div>
<%@include file="/ui/jsp/includes/footer.jspf"%>

<style>
    .form-horizontal {
        border: 0 none;
        margin-left: 0px;
        margin-top: 0px;
        padding-top: 0px;
        width: 100%;
    }

    .form-horizontal .control-label {
        float: left;
        font-weight: bold;
        padding-top: 5px;
        text-align: right;
        width: 160px;
    }

    label, select, button, input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] {
        cursor: pointer;
    }
</style>